#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QDialog>

namespace Ui {
class MainWindow;
}

class MainWindow : public QDialog
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    virtual void showEvent(QShowEvent *event) override;
    virtual void dragEnterEvent(QDragEnterEvent *event) override;
    virtual void dropEvent(QDropEvent *event) override;

private slots:
    void slotAddFile();
    void slotRemoveFile();
    void afterWindowShown();
    void slotFileListSelectChanged();
    void slotCancelSearch();

private:
    void loadFiles(QStringList & filenames);
    void loadFile(const QString & filename, class Progress & progress);
    void flushFileList();
    void flushUI();
    void search();
    void flushResult();

private:
    Ui::MainWindow *ui;
    class Storage * m_storage;
    bool m_searchCancelFlag;
};

#endif // MAINWINDOW_H
